package com.gxar.quick.ar.server.base.model.order.mapper;

import com.gxar.quick.ar.server.base.model.combo.vo.response.ComboListResponse;
import com.gxar.quick.ar.server.base.model.order.vo.response.OrderListResponse;
import com.gxar.quick.ar.server.db.model.ComboEntity;
import com.gxar.quick.ar.server.db.model.OrderEntity;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author linsy
 * @version 1.0
 * @created 2023/11/9 17:25
 */
@Mapper
public interface OrderMapStruct {
    OrderMapStruct INSTANCE = Mappers.getMapper(OrderMapStruct.class);


    @Mapping(target = "buyTime", source = "createdAt")
    @Mapping(target = "id", expression = "java(String.valueOf(entity.getId()))")
    OrderListResponse entityToListResponse(OrderEntity entity);

    List<OrderListResponse> entityToListResponses(List<OrderEntity> entity);

}
